//
//  UILabel+Extension.swift
//  MattressTool
//
//  Created by Coder Yang on 2023/11/19.
//

import UIKit

extension UILabel {
    
    /// 文本
    /// - Parameters:
    ///   - text: 文字
    ///   - color: 文字颜色
    ///   - font: 文本字体
    ///   - alignment: 对其方式
    ///   - lines: 行数
    convenience init(text: String?,
                     color: UIColor = .text,
                     font: UIFont = .body,
                     alignment: NSTextAlignment = .left,
                     lines: Int = 0) {
        self.init()
        self.text = text
        self.textColor = color
        self.font = font
        self.textAlignment = alignment
        self.numberOfLines = lines
        self.sizeToFit()
    }
}
